<extend name="extends/extend" />
<block name="loadCss">
</block>
<block name="script">
    <!-- sweetalert js -->
    <script src="__admin__/js/plugins/sweetalert/sweetalert.min.js"></script>

</block>
<block name="content">
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>
                            <i class="glyphicon glyphicon-log-out"></i>
                            模板列表
                        </h5>
                        <div class="ibox-tools">
                            <a href="javascript:location.reload(true);" class="btn btn-outline btn-info btn-xs">
                                <i class="fa fa-refresh"></i> 刷新
                            </a>
                        </div>
                    </div>
                    <div class="ibox-content">
                        <notempty name="themes">
                            <div class="row">
                                <div class="col-sm-12">

                                    <div class="alert alert-warning">
                                        <h3 style="margin: 0;"><i class="glyphicon glyphicon-tasks"></i> 模板选择:</h3>
                                        <div class="hr-line-dashed" style="margin: 10px 0"></div>
                                        <volist name="themes" id="v">
                                            <!--<a href="{:url('template/lists',['path'=> urlencode($v['path'])])}" class="btn btn-success btn-sm">{$v['name']}</a>-->
                                            <a href="?path={:urlencode($v['path'])}" class="btn btn-success btn-sm">{$v['name']}</a>
                                        </volist>
                                    </div>
                                </div>
                            </div>
                        </notempty>
                        <div class="row">
                            <div class="col-sm-12 m-b-xs">
                                <div class="btn-group">


                                </div>
                            </div>
                        </div>

                        <div class="table-responsive">
                            <table class="table table-striped">
                                <thead>
                                <tr>
                                    <th>序</th>
                                    <th>名称</th>
                                    <th>路径</th>
                                    <th>可写</th>
                                    <th>创建时间</th>
                                    <th>操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                <notempty name="files">
                                    <volist name="files" id="v">
                                        <tr>
                                            <td>{$i}</td>
                                            <td>{$v['name']}</td>
                                            <td>{$v['sortPath']}</td>
                                            <td>{:is_writable($v['path'])?'是':'否'}</td>
                                            <td>{:date('Y-m-d H:i:s',filectime($v['path']))}</td>
                                            <td>
                                                <a href="editFile?path={:urlencode($v['path'])}" class="btn btn-warning btn-sm">
                                                    <i class="glyphicon glyphicon-edit"></i> 编辑
                                                </a>
                                            </td>
                                        </tr>
                                    </volist>
                                    <else />
                                    <tr>
                                        <td colspan="8" align="center">暂无数据!</td>
                                    </tr>
                                </notempty>

                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>

        </div>
    </div>
</block>